package com.wang.validator.controller;

import com.wang.validator.config.GroupAdd;
import com.wang.validator.config.GroupUpdate;
import com.wang.validator.dto.UserDTO;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: wangning
 * @date: 2024/1/2 16:00
 */
@RestController
public class UserController {

    @PostMapping("/add")
    public String add(@Validated(GroupAdd.class) @RequestBody UserDTO userDTO){
        return "success";
    }

    @PostMapping("/update")
    public String update(@Validated(GroupUpdate.class) @RequestBody UserDTO userDTO){
        return "success";
    }

}
